test(mcp/security): 补齐 MCP 权限与事件联动测试矩阵#248
Conversation
|
|
||
| _, callErr := client.ListTools(context.Background()) | ||
| if callErr == nil || !errors.Is(callErr, context.DeadlineExceeded) { | ||
| t.Fatalf("expected deadline exceeded, got %v", callErr) |
There was a problem hiding this comment.
这里的断言 errors.Is(callErr, context.DeadlineExceeded) 过于严格,当前返回错误可能是初始化阶段的包装错误(例如 mcp: initialize session: ...),不一定保留可被 errors.Is 识别的错误链,导致测试可复现失败。建议改为断言更稳定的行为(例如错误消息包含 deadline exceeded 且区分初始化/tools/list 路径),或调整测试配置确保先完成 initialize 再触发 tools/list 超时。
|
/code -codex 帮我解决review的问题,然后帮我解决冲突 |
处理结果已修复 review 指出的问题:
本地验证:
冲突现状我检查了 PR 合并状态与三方合并结果:
该冲突属于主干 runtime 架构拆分后的结构性冲突( 阻塞点我已完成代码修复并生成本地提交:
因此当前无法直接把修复提交到该 PR 分支。你可以任选其一继续:
|
|
@xgopilot 我已经更新了权限,现在直接推送并继续处理 runtime 冲突 |
处理结果已直接推送到当前 PR 分支: 本次完成:
未完成项:
|
|
/code 那就改动,解决冲突 |
处理完成已按你的要求直接改动并解决冲突,代码已推送到当前 PR 分支 本次实际落地:
已执行验证:
已推送提交:
|
|
/code CI炸了,修复一下 |
处理结果已修复这次 CI 的不稳定失败,并已推送到当前 PR 分支 本次修复:
复现与验证:
说明:按自动化 push 流程同时在 fork 里创建了一个辅助 PR( |
|
/code -claude CI还是炸了,帮我修 |
CI 修复完成根因:CI 同时启用了
验证: 修复提交已推送,辅助 PR:Cai-Tang-www/neo-code#12 |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
- Add defer cancel() in TestExecuteToolCallWithPermissionDoesNotRecheckContextAfterSuccessfulEmit to satisfy go vet lostcancel check - Fix struct literal field alignment in internal/context/builder.go to pass gofmt Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
/code 修一下中文注释乱码 |
处理结果已修复你提到的中文注释乱码,并已推送到当前 PR 分支 本次修改:
修复内容:
已验证:
未执行:
|
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
关联
背景
MCP 接入与安全治理落地后,仍需要补齐 MCP + 权限 + 事件流 的联动测试矩阵,确保 ask/allow/deny、session remember、server/tool 优先级以及 stdio 生命周期边界都具备稳定验证。
本次改动
permission_request / permission_resolved / rule_id / reason / remember_scope事件联动refresh + execute并发稳定性测试permission_resolved事件缺失ToolCategory的观测字段问题覆盖点
验证
go test ./...